<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    <div id="app">
        <p><a v-bind:[attr]="url">百度链接</a></p>
        <p><button v-on:[things]="doSomething">单击事件</button></p>
    </div>


<!--引入vue文件-->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
    const vm = Vue.createApp({
        data() {
            return {
                attr: 'href',
                things: 'click',
                url: 'baidu.com',
            }
        },
        methods: {
            doSomething: function() {
                alert('触发了单击事件！')
            }
        }
    }).mount('#app');
</script>

</body>
</html>
